package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.ApproveHistoryLogModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by xiO on 2017/2/17.
 */
public interface ApproveHistoryLogRepository extends JpaRepository<ApproveHistoryLogModel, Integer>,
        JpaSpecificationExecutor<ApproveHistoryLogModel> {

    @Query("select u from ApproveHistoryLogModel u where u.初始报价单号 = ?1 order by  u.更新日期 desc ")
    List<ApproveHistoryLogModel> findStarIds(String ids);

    @Query("select u from ApproveHistoryLogModel u where u.初始报价单号 = ?1 and u.金融机构=?2   order by  u.更新日期 desc ")
    List<ApproveHistoryLogModel> findStarIdsAndOrgs(String ids,String orgs);
}